﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.VO;
using System.Data;

namespace Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.VO
{
    class UserVOChiTietHDNhap
    {
        private string _MaHDNhap;
        private string _MaSP;
        private int _SoLuong;
        private int _DonGiaNhap;

        public UserVOChiTietHDNhap(string MaHDNhap, string MaSP, int SoLuong, int DonGiaNhap)
        {
            this._MaHDNhap = MaHDNhap;
            this._MaSP = MaSP;
            this._SoLuong = SoLuong;
            this._DonGiaNhap = DonGiaNhap;
        }

        public string MAHOADONNHAP
        {
            get { return _MaHDNhap; }
            set { _MaHDNhap = value; }
        }

        public string MASANPHAM
        {
            get { return _MaSP; }
            set { _MaSP = value; }
        }

        public int SOLUONG
        {
            get { return _SoLuong; }
            set { _SoLuong = value; }
        }

        public int DONGIANHAP
        {
            get { return _DonGiaNhap; }
            set { _DonGiaNhap = value; }
        }

        public void CreateFormCTHD(DataRow dr)
        {
            if (dr != null)
            {
                this._MaHDNhap = dr.IsNull(0) ? string.Empty: Convert.ToString(dr[0]);
                this._MaSP = dr.IsNull(1) ? string.Empty : Convert.ToString(dr[1]);
                this._SoLuong = dr.IsNull(2) ? 0: Convert.ToInt32(dr[2]);
                this._DonGiaNhap = dr.IsNull(3) ? 0 : Convert.ToInt32(dr[3]);
            }
        }
    }
}
